<template>
	<view>
		<view class=" ">
			<uni-section title="通栏卡片" type="line">
				<uni-card title="门店详情">
					<view style="width: 130rpx;height: 130rpx; float: left; ">
						<image :src="arr[0].storeLogo" style="width: 125rpx;height: 125rpx; float: left;" mode="">
						</image>
					</view>
					<view class="" style="float: left;   width: 360rpx; margin-left: 30px;">
						<text style="float: left; width: 400rpx;">{{arr[0].storeName}}</text>
						<!-- 	<text style="float: left; width: 400rpx;">{{j.creationTime}}</text> -->
						<text style="float: left; width: 400rpx;">{{arr[0].address}}</text>
					</view>
				</uni-card>
			</uni-section>
		</view>
		<view class=" ">
			<uni-section title="通栏卡片" type="line">
				<uni-card title="订单详情">

					<view class="" style="float:left; width: 560rpx; ">
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx;">详细地址:</h4> <span
								style="float: left; width: 300rpx;">
								<u--textarea v-model="recyclingorder.address" placeholder="小区 门牌号" autoHeight>
								</u--textarea>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; margin-left: 30rpx;">联系人:</h4> <span
								style="float: left; width: 300rpx;">
								<u--textarea v-model="recyclingorder.contactsName" placeholder="请输入姓名" autoHeight>
								</u--textarea>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; ">联系电话:</h4> <span
								style="float: left; width: 300rpx;">
								<u--textarea v-model="recyclingorder.phone" placeholder="请输入手机号" autoHeight>
								</u--textarea>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; ">上门时间:</h4> <span
								style="float: left; width: 400rpx;">
								<uni-section :title="'v-model用法：' + single" type="date"></uni-section>
								<view class="example-body">
									<uni-datetime-picker v-model="single" />
								</view>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; ">回收内容:</h4> <span
								style="float: left; width: 400rpx;">
								<u--textarea v-model="recyclingorder.content" placeholder="如纸箱塑料瓶等 (非必填)" autoHeight>
								</u--textarea>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; ">预计重量:</h4> <span
								style="float: left; width: 400rpx;">
								<u--textarea v-model="recyclingorder.weight" placeholder="KG(非必填)" autoHeight>
								</u--textarea>
							</span>
						</text>
						<text style="float: left;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx; margin-left: 55rpx;">备注:</h4> <span
								style="float: left; width: 400rpx;">
								<u--textarea v-model="recyclingorder.remarks" placeholder="是否需要分类服务等等" autoHeight>
								</u--textarea>
							</span>
						</text>

					</view>
				</uni-card>
				<u-tabbar value="" @change="change1" :fixed="true" :placeholder="true"
					:safeAreaInsetBottom="true">
					<u-tabbar-item text="预约上门" style="background-color: #2BCDDD;" @click="yysm()"></u-tabbar-item>
				</u-tabbar>
			</uni-section>
		</view>
	</view>
</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				storeId: '',
				arr: [],
				single: '',
				recyclingorder: {},
			} 
		},
		onLoad(w) {
		this.storeId=	w.storeId 
			this.load()
		},
		methods: {
			load() {
				request({
					url: "xkuser/store/load2/" + this.storeId,
					method: 'get',
					success: (res) => {
						this.arr = res.data.data.arr2
						console.log(this.arr)
					}		
				})
			},
			yysm() {
				
				uni.getStorage({
									key: 'userid',
									success: res => {
										this.userid = res.data
										console.log("zaizhe", this.userid)
										this.recyclingorder.userId=this.userid	
											
									}
								});
				this.recyclingorder.storeId = this.arr[0].storeId
				this.recyclingorder.getTime = this.single
				console.log(this.recyclingorder.getTime)
				request({
					url: 'xkuser/recyclingorder/addorder',
					method:'POST',
					data: this.recyclingorder,
					dataType: 'json',
					success: (res) => {
						console.log(res.data.data.data)
                      uni.reLaunch({
                      	url:'./user'
                      })
					}
				})
			}
		}
	}
</script>

<style>

</style>
